import {requestUtil} from '@/utils/request'

/**
 * 获取下载地址
 * @param deviceType 下载的包类型
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export function getDownUrl(deviceType) {
    return requestUtil.get('/getDownUrl', {'deviceType': deviceType})
}

export function getDameRed() {
    return requestUtil.get('/pQ1rS2/dame_red');
}

export function get(id) {
    return requestUtil.get('/pQ1rS2/dame_red/get', {id: id});
}

export function createDameRed(newItem) {
    return requestUtil.post('/pQ1rS2/dame_red', newItem)
}

export function updateDameRed(id, updateItem) {
    return requestUtil.put(`/pQ1rS2/dame_red/${id}`, updateItem)
}

export function delDameRed(id) {
    return requestUtil.put(`/pQ1rS2/dame_red/d/${id}`)
}

export function getDomainIp() {
    return requestUtil.get('/pQ1rS2/dame_domain');
}

export function createDameIp(newItem) {
    return requestUtil.post('/pQ1rS2/dame_domain', newItem)
}

export function delDameRedIp(id) {
    return requestUtil.put(`/pQ1rS2/dame_domain/d/${id}`)
}

export function getLog() {
    return requestUtil.get('/log/list');
}

